execute store result score list_len temp run data get storage dab:system gameRule
execute store result score list_len1 temp run data get storage dab:system gameRule
scoreboard players operation list_len1 temp %= 3 Number
execute if score list_len1 temp matches 1 run scoreboard players add list_len temp 2
execute if score list_len1 temp matches 2 run scoreboard players add list_len temp 1

$execute store result entity @n[tag=UI-gamerule_control.ctr.DM,distance=..1,type=marker] data.page int 1 run scoreboard players add list_len temp $(id)
function dab:system/ui/gamerules/set_page with entity @n[tag=UI-gamerule_control.ctr.DM,distance=..1,type=marker] data

scoreboard players reset list_len temp
scoreboard players reset list_len1 temp
data remove entity @n[tag=UI-gamerule_control.ctr.DM,distance=..1,type=marker] data.SGTemp